/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author juan__000
 */
public class Inicializacao extends javax.swing.JFrame {

    /**
     * Creates new form Inicializacao
     */
    public Inicializacao() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panePrincipal = new javax.swing.JPanel();
        logo = new javax.swing.JLabel();
        InicializaBtn = new javax.swing.JButton();
        IntrucaoBtn = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        instrucao = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        backBtn = new javax.swing.JButton();
        proxBtn = new javax.swing.JButton();
        antBtn = new javax.swing.JButton();
        introjogo = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        Nome = new javax.swing.JTextField();
        voltBtn = new javax.swing.JButton();
        iniciar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("RoBoZaNa!");
        setExtendedState(6);
        setResizable(false);
        getContentPane().setLayout(new java.awt.CardLayout());

        logo.setFont(new java.awt.Font("Robotaur 3D", 0, 36)); // NOI18N
        logo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Logo Reduzida (1).png"))); // NOI18N

        InicializaBtn.setFont(new java.awt.Font("Robotaur 3D", 0, 18)); // NOI18N
        InicializaBtn.setText("Buscar jogo");
        InicializaBtn.setToolTipText("Procurar por um servidor");
        InicializaBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                InicializaBtnActionPerformed(evt);
            }
        });

        IntrucaoBtn.setFont(new java.awt.Font("Robotaur 3D", 0, 18)); // NOI18N
        IntrucaoBtn.setText("Instruções");
        IntrucaoBtn.setToolTipText("Instruções de como jogar");
        IntrucaoBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                IntrucaoBtnActionPerformed(evt);
            }
        });
        IntrucaoBtn.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                IntrucaoBtnKeyReleased(evt);
            }
        });

        jButton1.setFont(new java.awt.Font("Robotaur 3D", 0, 18)); // NOI18N
        jButton1.setText("Criar jogo");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panePrincipalLayout = new javax.swing.GroupLayout(panePrincipal);
        panePrincipal.setLayout(panePrincipalLayout);
        panePrincipalLayout.setHorizontalGroup(
            panePrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panePrincipalLayout.createSequentialGroup()
                .addContainerGap(92, Short.MAX_VALUE)
                .addGroup(panePrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panePrincipalLayout.createSequentialGroup()
                        .addGroup(panePrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 213, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(panePrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(InicializaBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(IntrucaoBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGap(356, 356, 356))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panePrincipalLayout.createSequentialGroup()
                        .addComponent(logo, javax.swing.GroupLayout.PREFERRED_SIZE, 836, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(62, 62, 62))))
        );
        panePrincipalLayout.setVerticalGroup(
            panePrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panePrincipalLayout.createSequentialGroup()
                .addGap(77, 77, 77)
                .addComponent(logo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(InicializaBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26)
                .addComponent(IntrucaoBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(184, 184, 184))
        );

        getContentPane().add(panePrincipal, "1");

        jLabel2.setFont(new java.awt.Font("Robotaur 3D", 0, 18)); // NOI18N
        jLabel2.setText("Instruções");

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.LINE_AXIS));

        backBtn.setFont(new java.awt.Font("Robotaur 3D", 0, 12)); // NOI18N
        backBtn.setText("Voltar");
        backBtn.setToolTipText("Voltar ao menu principal");
        backBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                backBtnActionPerformed(evt);
            }
        });

        proxBtn.setFont(new java.awt.Font("Robotaur 3D", 0, 12)); // NOI18N
        proxBtn.setText("Próximo");
        proxBtn.setToolTipText("Próximo passo");
        proxBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                proxBtnActionPerformed(evt);
            }
        });

        antBtn.setFont(new java.awt.Font("Robotaur 3D", 0, 12)); // NOI18N
        antBtn.setText("Anterior");
        antBtn.setToolTipText("Passo Anterior");
        antBtn.setEnabled(false);

        javax.swing.GroupLayout instrucaoLayout = new javax.swing.GroupLayout(instrucao);
        instrucao.setLayout(instrucaoLayout);
        instrucaoLayout.setHorizontalGroup(
            instrucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(instrucaoLayout.createSequentialGroup()
                .addGap(69, 69, 69)
                .addGroup(instrucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addGroup(instrucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(instrucaoLayout.createSequentialGroup()
                            .addComponent(backBtn)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(proxBtn)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(antBtn))
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 505, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(416, Short.MAX_VALUE))
        );
        instrucaoLayout.setVerticalGroup(
            instrucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(instrucaoLayout.createSequentialGroup()
                .addGap(42, 42, 42)
                .addComponent(jLabel2)
                .addGap(26, 26, 26)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 351, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 49, Short.MAX_VALUE)
                .addGroup(instrucaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(proxBtn)
                    .addComponent(backBtn)
                    .addComponent(antBtn))
                .addGap(103, 103, 103))
        );

        getContentPane().add(instrucao, "2");

        jLabel1.setFont(new java.awt.Font("Robotaur 3D", 0, 24)); // NOI18N
        jLabel1.setText("Digite o seu nickname:");

        Nome.setFont(new java.awt.Font("Robotaur 3D", 0, 24)); // NOI18N
        Nome.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                NomeKeyReleased(evt);
            }
        });

        voltBtn.setFont(new java.awt.Font("Robotaur 3D", 0, 24)); // NOI18N
        voltBtn.setText("Voltar");
        voltBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                voltBtnActionPerformed(evt);
            }
        });

        iniciar.setFont(new java.awt.Font("Robotaur 3D", 0, 18)); // NOI18N
        iniciar.setText("Iniciar");
        iniciar.setEnabled(false);
        iniciar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                iniciarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout introjogoLayout = new javax.swing.GroupLayout(introjogo);
        introjogo.setLayout(introjogoLayout);
        introjogoLayout.setHorizontalGroup(
            introjogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(introjogoLayout.createSequentialGroup()
                .addGap(111, 111, 111)
                .addGroup(introjogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(introjogoLayout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(18, 18, 18)
                        .addComponent(Nome, javax.swing.GroupLayout.PREFERRED_SIZE, 358, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(introjogoLayout.createSequentialGroup()
                        .addComponent(voltBtn)
                        .addGap(423, 423, 423)
                        .addComponent(iniciar, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(98, Short.MAX_VALUE))
        );
        introjogoLayout.setVerticalGroup(
            introjogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(introjogoLayout.createSequentialGroup()
                .addGap(176, 176, 176)
                .addGroup(introjogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Nome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(83, 83, 83)
                .addGroup(introjogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(voltBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(iniciar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(627, Short.MAX_VALUE))
        );

        getContentPane().add(introjogo, "card4");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void InicializaBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_InicializaBtnActionPerformed
        this.rootPane.setContentPane(introjogo);
        introjogo.setVisible(true);
    }//GEN-LAST:event_InicializaBtnActionPerformed

    private void IntrucaoBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_IntrucaoBtnActionPerformed

        this.rootPane.setContentPane(instrucao);
        instrucao.setVisible(true);
    }//GEN-LAST:event_IntrucaoBtnActionPerformed

    private void IntrucaoBtnKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_IntrucaoBtnKeyReleased
        
    }//GEN-LAST:event_IntrucaoBtnKeyReleased

    private void proxBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_proxBtnActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_proxBtnActionPerformed

    private void backBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backBtnActionPerformed
        this.rootPane.setContentPane(panePrincipal);
        panePrincipal.setVisible(true);
    }//GEN-LAST:event_backBtnActionPerformed

    private void voltBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_voltBtnActionPerformed
        this.rootPane.setContentPane(panePrincipal);
        panePrincipal.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_voltBtnActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton1ActionPerformed

    private void NomeKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_NomeKeyReleased
        iniciar.setEnabled(!Nome.getText().isEmpty());
    }//GEN-LAST:event_NomeKeyReleased

    private void iniciarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_iniciarActionPerformed
        Telajogo i=new Telajogo(Nome.getText());
        i.setVisible(true);
        this.dispose();
    }//GEN-LAST:event_iniciarActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Inicializacao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Inicializacao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Inicializacao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Inicializacao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Inicializacao().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton InicializaBtn;
    private javax.swing.JButton IntrucaoBtn;
    private javax.swing.JTextField Nome;
    private javax.swing.JButton antBtn;
    private javax.swing.JButton backBtn;
    private javax.swing.JButton iniciar;
    private javax.swing.JPanel instrucao;
    private javax.swing.JPanel introjogo;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel logo;
    private javax.swing.JPanel panePrincipal;
    private javax.swing.JButton proxBtn;
    private javax.swing.JButton voltBtn;
    // End of variables declaration//GEN-END:variables
}
